import {listen} from "@tauri-apps/api/event";
import {sendImgMessage} from "../actions/send_img_message.ts";
import {addListener} from "../actions/listeners.ts";

export const sendMessageOtherWindow = async () => {
    await listen("send-message-other-window", (event) => {
        let data = event.payload;
        sendImgMessage(data).then(r => {
            console.log("send-message-other-window success");
        });
    }).then((unListenFn)=> {
        addListener(unListenFn);
    });
};